#ifndef HELPBROWSER_H
#define HELPBROWSER_H
#include <QApplication>
#include <QMainWindow>
#include <QPushButton>
#include <QHelpEngine>
#include <QHelpContentWidget>
#include <QHelpIndexWidget>
#include <QTabWidget>
#include <QSplitter>
#include <QTextBrowser>
#include <QFileInfo>
#include <QMessageBox>

// 自定义文本浏览器，用于显示帮助内容
class HelpBrowser : public QTextBrowser
{
public:
    HelpBrowser(QHelpEngine* helpEngine, QWidget* parent = nullptr)
        : QTextBrowser(parent), m_helpEngine(helpEngine) {}

    QVariant loadResource(int type, const QUrl &name) override
    {
        if (name.scheme() == "qthelp")
            return QVariant(m_helpEngine->fileData(name));
        else
            return QTextBrowser::loadResource(type, name);
    }

private:
    QHelpEngine* m_helpEngine;
};
#endif // HELPBROWSER_H
